﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPageContent.master" AutoEventWireup="false"
    CodeFile="PaymentOrderDtl.aspx.vb" Inherits="Payment_PaymentOrderDtl" %>

<%@ Register Src="~/UserControls/DDL.ascx" TagName="DoubleFilteredDropDownList" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/OneFilteredDropDownList.ascx" TagName="OneFilteredDropDownList"
    TagPrefix="uc2" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Header" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgPaymentOrderDtl">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgPaymentOrderDtl" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="20">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <br />
    <br />
    <table style="table-layout: fixed;">
        <tr>
            <td>
                <asp:Label ID="lblTransYear" runat="server" Text="<%$ Resources:SystemResource, Year %>"></asp:Label>
            </td>
            <td>
                <telerik:RadNumericTextBox ID="rtbTransYear" runat="server" MaxLength="4" MaxValue="2020"
                    IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true">
                    <NumberFormat DecimalDigits="0" GroupSizes="4" />
                </telerik:RadNumericTextBox>
            </td>
            <td>
                <asp:Label ID="lblManrdpOrderDate" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                <asp:Label ID="lblOrderDate" runat="server" meta:ResourceKey="lblOrderDate"></asp:Label>
            </td>
            <td>
                <telerik:RadDatePicker runat="server" ID="rdpOrderDate" Culture="English (United States)"
                    ShowPopupOnFocus="true">
                    <DateInput ID="DateInput1" DateFormat="dd/MM/yyyy" runat="server">
                    </DateInput></telerik:RadDatePicker>
                <asp:RequiredFieldValidator ID="rfvrdpOrderDate" runat="server" ControlToValidate="rdpOrderDate"
                    ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valPaymentOrder"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblManrtbNumber" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                <asp:Label ID="lblPayOrderNo" runat="server" meta:ResourceKey="lblPayOrderNo"></asp:Label>
            </td>
            <td>
                <telerik:RadTextBox ID="rtbPayOrderNo" runat="server" ValidationGroup="valPaymentOrder">
                </telerik:RadTextBox>
                <asp:RequiredFieldValidator ID="rfvrtbNumber" runat="server" ControlToValidate="rtbPayOrderNo"
                    ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valPaymentOrder"></asp:RequiredFieldValidator>
            </td>
            <td>
                <asp:Label ID="lblManType" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                <asp:Label ID="lblPayMeth" runat="server" meta:ResourceKey="lblPayMeth"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbPayMeth" runat="server" DataSourceId="odsPayMeth"
                    DataValueField="MINOR" IsRequired="false" DataTextField="<%$ Resources:SystemResource, Lookup %>"
                    DefaultChoosedItem="ChooseOne" />
                <asp:Label ID="lblManPayMeth" runat="server" Visible="false" meta:ResourceKey="lblPayMethMissing"
                    SkinID="Mandetory"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblCostCenter" runat="server" Text="<%$ Resources:SystemResource, CostCenter %>"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbCostCenter" runat="server" DataSourceId="odsCostCenter"
                    DataValueField="MINOR" IsRequired="false" DataTextField="<%$ Resources:SystemResource, Lookup %>"
                    DefaultChoosedItem="ChooseOne" />
            </td>
            <td>
                <asp:Label ID="lblMainCostCenter" runat="server" Text="<%$ Resources:SystemResource, MainCostCenter %>"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbMainCostCenter" runat="server" DataSourceId="odsMainCostCenter"
                    DataValueField="MINOR" IsRequired="false" DataTextField="<%$ Resources:SystemResource, Lookup %>"
                    DefaultChoosedItem="ChooseOne" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblSupplier" runat="server" Text="<%$ Resources:SystemResource, Supplier %>"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbSupplier" runat="server" DataSourceId="odsSupplier"
                    DataValueField="SupplierID" IsRequired="false" DataTextField="<%$ Resources:SystemResource, SupplierName %>"
                    DefaultChoosedItem="ChooseOne" />
            </td>
            <td>
                <asp:Label ID="lblRemarks" runat="server" Text="<%$ Resources:SystemResource, Remarks %>"></asp:Label>
            </td>
            <td>
                <telerik:RadTextBox ID="rtbRemarks" runat="server" SkinID="Remarks">
                </telerik:RadTextBox>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <!------------------------------------------------ Details ---------------------------------------------------->
                <telerik:RadGrid ID="rgPaymentOrderDtl" runat="server" GridLines="None" DataSourceID="sdsPaymentOrderDtl"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" ShowFooter="True" AllowAutomaticUpdates="True"
                    AllowPaging="True" AutoGenerateColumns="False" GroupPanel-Text="<%$ Resources:MainGrid ,GroupPanelText %>"
                    CellSpacing="0">
                    <MasterTableView Width="100%" Caption="<%$ Resources:MainGrid , LinesCaption %>"
                        CommandItemDisplay="TopAndBottom" DataKeyNames="ID" TableLayout="Fixed" HorizontalAlign="NotSet"
                        DataSourceID="sdsPaymentOrderDtl" NoMasterRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>">
                        <CommandItemTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="ibtnInitInsert" CommandName="InitInsert" runat="server" ImageUrl="../Design/images/Grid/AddRecord.gif" />
                                        <asp:LinkButton ID="lbtnInitInsert" runat="server" Font-Size="14px" Text="<%$ Resources:MainGrid , AddNew %>"
                                            CommandName="InitInsert" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="ibtnEditSelected" CommandName="EditSelected" runat="server"
                                            ImageUrl="../Design/images/Grid/Edit.gif" />
                                        <asp:LinkButton ID="lbtnEditSelected" runat="server" Font-Size="14px" Text="<%$ Resources:MainGrid , EditSelected %>"
                                            CommandName="EditSelected" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="ibtnDeleteSelected" CommandName="DeleteSelected" runat="server"
                                            ImageUrl="../Design/images/Grid/Delete.gif" />
                                        <asp:LinkButton ID="lbtnDeleteSelected" Font-Size="14px" OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>"
                                            runat="server" Text="<%$ Resources:MainGrid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="ibtnRebindGrid" CommandName="RebindGrid" runat="server" ImageUrl="../Design/images/Grid/Refresh.gif" />
                                        <asp:LinkButton ID="lbtnRebindGrid" Font-Size="14px" runat="server" Text="<%$ Resources:MainGrid , Refresh %>"
                                            CommandName="RebindGrid" />
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton">
                                <HeaderStyle Width="30px" />
                                <ItemStyle Width="30px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID"
                                UniqueName="ID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LPOYear" meta:ResourceKey="gbcLPOYear" SortExpression="LPOYear"
                                UniqueName="LPOYear">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LPONo" meta:ResourceKey="gbcLPONo" SortExpression="LPONo"
                                UniqueName="LPONo">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProgramNo" meta:ResourceKey="gbcProgram" SortExpression="ProgramNo"
                                UniqueName="ProgramNo">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProjectNo" meta:ResourceKey="gbcProject" SortExpression="ProjectNo"
                                UniqueName="ProjectNo">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AccountNo" HeaderText="<%$ Resources:SystemResource, AccountNo %>"
                                SortExpression="AccountNo" UniqueName="AccountNo">
                                <HeaderStyle Width="85px" />
                                <ItemStyle Width="85px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="AccountNo" DataSourceID="odsAccount" HeaderText="<%$ Resources:SystemResource, AccountName %>"
                                ListTextField="<%$ Resources:SystemResource, Account %>" ListValueField="AccountNo"
                                UniqueName="AccountNo" EnableEmptyListItem="True">
                                <HeaderStyle Width="120px" />
                                <ItemStyle Width="120px" /> 
                                
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn DataField="Amount" meta:ResourceKey="gbcAmount" ReadOnly="True"
                                SortExpression="Amount" UniqueName="Amount" Visible="true" Aggregate="Sum" DataFormatString="{0:###,###.##}">
                                <HeaderStyle Width="75px" />
                                <ItemStyle Width="75px" />
                                <FooterStyle BackColor="blue" ForeColor="White" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Remarks" meta:ResourceKey="gbcRemarks" ReadOnly="True"
                                SortExpression="Remarks" UniqueName="Remarks" Visible="false">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridHyperLinkColumn DataTextField="RecordStatus" Visible="false" SortExpression="RecordStatus"
                                UniqueName="RecordStatus">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridHyperLinkColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmTitle="Confirm" ButtonType="ImageButton" CommandName="Delete">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings ColumnNumber="2" EditFormType="Template" CaptionDataField="ID"
                            CaptionFormatString="Edit properties of {0}" InsertCaption="New Line">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="ImageButton" InsertText="Insert User" UpdateText="Update record"
                                UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                            <FormTemplate>
                                <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none">
                                    <tr>
                                        <td >
                                            <asp:Label ID="lblNewLine" Font-Bold="true" Font-Italic="true" runat="server" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "New Line", "Update Line") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblLPOYear" runat="server" meta:ResourceKey="lblLPOYear"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rtbLPOYear" runat="server" MaxLength="4" MaxValue="2020"
                                                IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                                                Text='<%# Bind("LPOYear") %>'>
                                                <NumberFormat DecimalDigits="0" GroupSizes="4" />
                                            </telerik:RadNumericTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblLPONo" runat="server" meta:ResourceKey="lblLPONo"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtxtLPONo" runat="server" Text='<%# Bind("LPONo") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblProgramNo" runat="server" Text="<%$ Resources:SystemResource , lblProgram %>"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbProgramNo" runat="server" Text='<%# Bind("ProgramNo") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblProjectNo" runat="server" Text="<%$ Resources:SystemResource, Project %>"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtxtProjectNo" runat="server" Text='<%# Bind("ProjectNo") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                           <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblManrcbAccount" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                            <asp:Label ID="lblrcbAccount" runat="server" Text="<%$ Resources:SystemResource, lblAccount %>"></asp:Label>
                                        </td>
                                        <td>
                                            <uc1:DoubleFilteredDropDownList ID="WUCAcc" IsRequired="false" runat="server" DataSourceId="odsAccount"
                                                DataTextField="<%$ Resources:SystemResource, Account %>" DataValueField="AccountNo"
                                                SelectedValue='<%# Bind("AccountNo") %>' DefaultChoosedItem="ChooseOne" ValidationGroup="valEditMode" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                           <td>
                                        </td>
                                           <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblManrntbAmount" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                            <asp:Label ID="lblAmount" runat="server" Text="<%$ Resources:SystemResource , Amount %>"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rntbAmount" runat="server" Text='<%# Bind("Amount") %>'
                                                IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true">
                                                <NumberFormat DecimalDigits="2" />
                                            </telerik:RadNumericTextBox>
                                        </td>
                                        <td style="width: 100px">
                                            <asp:RequiredFieldValidator ID="rfvrntbAmount" runat="server" ControlToValidate="rntbAmount"
                                                ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valEditMode"></asp:RequiredFieldValidator>
                                        </td>
                                           <td>
                                        </td>
                                           <td>
                                        </td>
                                           <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblRemarks" runat="server" Text="<%$ Resources:SystemResource, Remarks %>"></asp:Label>
                                        </td>
                                        <td >
                                            <telerik:RadTextBox ID="rtbRemarks" SkinID="Remarks" runat="server" Text='<%# Bind("Remarks") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                        
                                   
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                            <div style="margin-top: 10px">
                                                <telerik:RadButton ID="btnInsert" Text="<%$ Resources:SystemResource, btnInsert %>" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>'
                                                    runat="server" CommandName="PerformInsert" Icon-PrimaryIconCssClass="rbOk" ValidationGroup="valEditMode">
                                                </telerik:RadButton>
                                                <telerik:RadButton ID="btnUpdate" Text="<%$ Resources:SystemResource, btnUpdate %>"  Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "False", "True") %>'
                                                    runat="server" CommandName="Update" CausesValidation="true" ValidationGroup="ValEditMode"
                                                    Icon-PrimaryIconCssClass="rbOk">
                                                </telerik:RadButton>
                                                &nbsp;
                                                <telerik:RadButton ID="rbtnCancel" Text="<%$ Resources:SystemResource, btnCancel %>"  runat="server" CausesValidation="False"
                                                    CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
                                                </telerik:RadButton>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                            Font-Underline="False" HorizontalAlign="Center" Wrap="True" />
                    </MasterTableView>
             
                    <ClientSettings AllowDragToGroup="False">
                        <Scrolling AllowScroll="false" ScrollHeight="400px" />
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <FilterMenu EnableTheming="True">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                </telerik:RadGrid>
                <asp:HiddenField ID="hdnPayOrdID" runat="server" />
                <asp:HiddenField ID="hdnRecordStatus" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: left">
                <br />
                <asp:Label ID="lblFileUpload" runat="server" meta:ResourceKey="lblFileUpload"></asp:Label>
                &nbsp;&nbsp;
                <telerik:RadAsyncUpload runat="server" ID="AsyncUploadVoucher" meta:ResourceKey="RadUpload"
                    AllowedFileExtensions="jpg,jpeg,png,gif,bmp,txt,pdf,doc,docx,xls,xlsx">
                </telerik:RadAsyncUpload>
                <asp:Label ID="lblUploadError" runat="server" Visible="false" meta:ResourceKey="lblUploadError"
                    SkinID="Mandetory"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <telerik:RadGrid runat="server" ID="rgAttachments" Width="800px" DataSourceID="odsAttachments"
                    ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false" AllowAutomaticDeletes="True">
                    <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                        DataKeyNames="FileID" PageSize="7" HierarchyLoadMode="ServerOnDemand" Width="800px">
                        <Columns>
                            <telerik:GridBoundColumn DataField="FileID" HeaderText="FileID" ReadOnly="True" SortExpression="FileID"
                                UniqueName="FileID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Voucher_IDN" SortExpression="Voucher_IDN" UniqueName="Voucher_IDN"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridHyperLinkColumn Text="Open" UniqueName="OpenAttachment" DataNavigateUrlFields="Voucher_IDN,FileID"
                                DataNavigateUrlFormatString="~/UserControls/DisplayForm.aspx?Voucher_IDC=V&Voucher_IDN={0}&FileID={1}">
                            </telerik:GridHyperLinkColumn>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="<%$ Resources:SystemResource , FileName %>"
                                SortExpression="Name" UniqueName="Name">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ContentType" HeaderText="<%$ Resources:SystemResource , FileType %>"
                                SortExpression="ContentType" UniqueName="ContentType">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmTitle="Confirm" ButtonType="ImageButton" CommandName="Delete">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridButtonColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <asp:ObjectDataSource ID="odsAttachments" runat="server" SelectMethod="QueryDatabase"
                    TypeName="DBtblFilesSP" DeleteMethod="QueryDatabase">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                        <asp:Parameter DefaultValue="RtvFile" Name="Operation" Type="String" />
                        <asp:Parameter Name="FileID" Type="String" />
                        <asp:Parameter Name="Voucher_IDC" DefaultValue="PO" Type="String" />
                        <asp:ControlParameter ControlID="hdnPayOrdID" Name="Voucher_IDN" PropertyName="Value"
                            Type="String" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="ContentType" Type="String" />
                        <asp:Parameter Name="Data" Type="String" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                        <asp:Parameter DefaultValue="DeleteFile" Name="Operation" Type="String" />
                        <asp:Parameter Name="FileID" Type="String" />
                        <asp:Parameter Name="Voucher_IDC" Type="String" />
                        <asp:ControlParameter ControlID="hdnPayOrdID" Name="Voucher_IDN" PropertyName="Value"
                            Type="String" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="ContentType" Type="String" />
                        <asp:Parameter Name="Data" Type="String" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
    <br />
    <asp:ObjectDataSource ID="odsCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsCostCenter2" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br />
    <br />
    <telerik:RadButton ID="rbtnSave" runat="server" Text="<%$ Resources:SystemResource , rbtnSave %>">    </telerik:RadButton>
    &nbsp;
    <telerik:RadButton ID="rbtnDelete" runat="server" Text="<%$ Resources:SystemResource , rbtnDelete %>"
        CausesValidation="false">
    </telerik:RadButton>
    &nbsp;
    <telerik:RadButton ID="rbtnCancel" runat="server" Text="<%$ Resources:SystemResource , rbtnCancel %>"
        CausesValidation="false">
    </telerik:RadButton>
    <sds:SessionDataSource ID="sdsPaymentOrderDtl" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"
        SelectCommand="SELECT [ID] ,[PayOrdID]  ,[LPOYear] ,[LPOID] as LPONo ,[ProgramNo] ,[ProjectNo] ,[AccountNo] ,[Amount] ,[Remarks] ,[RecordStatus] ,[LastUpdateBy] ,[LastUpdateDate] FROM [PaymentOrderDtl] where   PayOrdID = @PayOrdID and RecordStatus <> 1 "
        DeleteCommand="DELETE FROM [PaymentOrderDtl] WHERE [ID] = ?" InsertCommand="INSERT INTO [PaymentOrderDtl] ([PayOrdID]  ,[LPOYear] ,[LPOID]  ,[ProgramNo] ,[ProjectNo] ,[AccountNo] ,[Amount] ,[Remarks] ,[RecordStatus],[LastUpdateBy] ,[LastUpdateDate])   VALUES(@PayOrdID  , , , , ,, , , , ,)"
        UpdateCommand="UPDATE [PaymentOrderDtl] SET [PayOrdID] = @PayOrdID,[LPOYear] = @LPOYear,[LPOID] = @LPOID,[ProgramNo] = @ProgramNo,[ProjectNo] = @ProjectNo,[AccountNo] = @AccountNo,[Amount] = @Amount,[Remarks] = @Remarks ,RecordStatus =@RecordStatus ,[LastUpdateBy] = @LastUpdateBy ,[LastUpdateDate] = @LastUpdateDate WHERE UPDATE [PaymentOrderDtl] SET [PayOrdID] = ?,[LPOYear] = ?,[LPOID] = ?,[ProgramNo] = ?,[ProjectNo] = ?,[AccountNo] = @AccountNo,[Amount] = ?,[Remarks] = ? ,RecordStatus =? ,[LastUpdateBy] = ? ,[LastUpdateDate] = ?"
        PrimaryKeyFields="ID" OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues"
        ClearSessionOnInitialLoad="True" SessionKey="System.Web.UI.Page_sdsVoucher">
        <SelectParameters>
            <asp:ControlParameter ControlID="hdnPayOrdID" Name="PayOrdID" PropertyName="Value"
                Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="hdnPayOrdID" Name="PayOrdID" PropertyName="Value"
                Type="String" />
            <asp:Parameter Name="Year" />
            <asp:Parameter Name="PayOrderNo" />
            <asp:Parameter Name="ProgramNo" />
            <asp:Parameter Name="AccountNo" />
            <asp:Parameter Name="Amount" />
            <asp:Parameter Name="Credit" />
            <asp:Parameter Name="CostCenter" />
            <asp:Parameter Name="Remarks" />
            <asp:Parameter Name="RecordStatus" />
            <asp:Parameter Name="LastUpdateBy" />
            <asp:Parameter Name="LastUpdateDate" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="hdnPayOrdID" Name="PayOrdID" PropertyName="Value"
                Type="String" />
        </InsertParameters>
    </sds:SessionDataSource>
    <asp:ObjectDataSource ID="odsPaymentOrderDtl" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBPaymentOrderDtlSP" DeleteMethod="QueryDatabase" InsertMethod="QueryDatabase"
        UpdateMethod="QueryDatabase">
        <DeleteParameters>
            <asp:Parameter Name="QueryType" Type="Object" />
            <asp:Parameter Name="Operation" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="PayOrdID" Type="String" />
            <asp:Parameter Name="Year" Type="String" />
            <asp:Parameter Name="PayOrderNo" Type="String" />
            <asp:Parameter Name="ProgramNo" Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="Amount" Type="String" />
            <asp:Parameter Name="Credit" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="QueryType" Type="Object" />
            <asp:Parameter Name="Operation" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="PayOrdID" Type="String" />
            <asp:Parameter Name="Year" Type="String" />
            <asp:Parameter Name="PayOrderNo" Type="String" />
            <asp:Parameter Name="ProgramNo" Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="Amount" Type="String" />
            <asp:Parameter Name="Credit" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="ShowPaymentOrderDtl" Name="Operation" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
            <asp:ControlParameter ControlID="hdnPayOrdID" Name="PayOrdID" PropertyName="Value"
                Type="String" />
            <asp:Parameter Name="Year" Type="String" />
            <asp:Parameter Name="PayOrderNo" Type="String" />
            <asp:Parameter Name="ProgramNo" Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="Amount" Type="String" />
            <asp:Parameter Name="Credit" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="QueryType" Type="Object" />
            <asp:Parameter Name="Operation" Type="String" />
            <asp:Parameter Name="ID" Type="String" />
            <asp:Parameter Name="PayOrdID" Type="String" />
            <asp:Parameter Name="Year" Type="String" />
            <asp:Parameter Name="PayOrderNo" Type="String" />
            <asp:Parameter Name="ProgramNo" Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="Amount" Type="String" />
            <asp:Parameter Name="Credit" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsMainCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvMainCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsAccount" runat="server" SelectMethod="QueryDatabase"
        TypeName="AccountsSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvAllChildAccounts" Name="Operation" Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="AccountNameAr" Type="String" />
            <asp:Parameter Name="AccountNameEn" Type="String" />
            <asp:Parameter Name="ParentID" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="AccountType" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsSupplier" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBSupplierSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvSupplier" Name="Operation" Type="String" />
            <asp:Parameter Name="SupplierID" Type="String" />
            <asp:Parameter Name="SupplierName" Type="String" />
            <asp:Parameter Name="Mobile" Type="String" />
            <asp:Parameter Name="Tel" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankAccountsID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsRecordStatus" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvRecordStatus" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsPayMeth" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvPayMeth" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
